home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 3_9.lha / 3_9 / 3_9b.c < prev    next >
C/C++ Source or Header  |  1993-08-08  |  339b  |  18 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / reverse the characters within the string s
  6. include <swap.h>
  7. include <string.h>
  8. oid rev(char *s)
  9.  
  10.    if (!s)
  11. return;
  12.  
  13.    char *e = s + strlen(s) - 1;
  14.  
  15.    for ( ; s < e ; s++, e--)
  16. swap(*s, *e);
  17.  
  18.